﻿using System;
using System.Windows.Controls;
using System.Windows.Navigation;

namespace Wintellect.Touch
{
    public partial class GestureServicePage : Page
    {
        public GestureServicePage()
        {
            InitializeComponent();
        }

        // Executes when the user navigates to this page.
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
        }

        // Codebehind
        private void GestureListener_Tap(object sender, GestureEventArgs e)
        {
            PublishMessage("Tap");
        }

        private void GestureListener_DragStarted(object sender, DragStartedGestureEventArgs e)
        {
            PublishMessage("Drag Started");
        }

        private void GestureListener_DragDelta(object sender, DragDeltaGestureEventArgs e)
        {
            PublishMessage("Drag Delta");
        }

        private void GestureListener_DragCompleted(object sender, DragCompletedGestureEventArgs e)
        {
            PublishMessage("Drag Completed");
        }

        private void GestureListener_DoubleTap(object sender, GestureEventArgs e)
        {
            ResultsList.Items.Insert(0, "DoubleTap");
        }

        private void GestureListener_Hold(object sender, GestureEventArgs e)
        {
            PublishMessage("Hold");
        }

        //private void GestureListener_SimplePinchStarted(object sender, SimplePinchStartedEventArgs e)
        //{
        //    PublishMessage("Pinch Started");
        //}

        //private void GestureListener_SimplePinchDelta(object sender, SimplePinchGestureEventArgs e)
        //{
        //    PublishMessage("Pinch Delta " + e.ScaleDelta);
        //}

        //private void GestureListener_SimplePinchCompleted(object sender, SimplePinchCompletedEventArgs e)
        //{
        //    PublishMessage("Pinch Completed");
        //}

        private void PublishMessage(String message)
        {
            ResultsList.Items.Insert(0, message);
        }
    }
}
